Open Dev Kit Documentation :: Demo - RPG
Role-playing game utilizingHow it Works
- Game Initialization
- Upon starting the game, the
Start function is triggered. This initializes theStartingMap Scene and the player's starting location via theScene Add function, which derives this data from thegSettings variable that can be accessed via the menu.Tools > Game Settings
The opening cinematic sequence with the dialog boxes and the music is triggered by theOpened Scene Event of theStartingMap Scene . This event is designed to execute whenever aScene is loaded. - Player Controls
- During that cinematic sequence, which
Keybinds are usable or not is determined by theEnable/Disable Game Input andLock/Unlock Game Input functions. TheInterface Keybinds is used for interaction with message boxes during dialog cutscenes whileRegularGame is used for the actual gameplay. By clicking , you can view and edit them.Tools > Keybinds - Active Scenes
- The RPG demo has an
SceneAdd adds aScene to the current list of activeScenes and defines how theScene interacts (overlay or parallel), and even determines input behavior when theScene is active,- while
SceneRemove removes a specificScene from the active list, while also automatically shifting interaction focus to the next availableScene (useful for closing UI elements/menus and transitioning back to gameplay).
ActiveScene class, which is essentially a system to dynamically manage and switch between different UI and gameplay elements, or transitioning between different parts of the game without unloading other content. This is achieved using theSceneAdd andSceneRemove functions.
Creating a New Item
Follow these steps to add a new item to the demo:
- Create the New Item:
- Click
to open the menu containing properties belonging to theTools > ItemsItem class. - Click the
Create Item icon and specify a name for the new item.
- Click
- Configure Properties:
- After it is created, you will need to give it functionality by setting up its properties depending on what kind of item it is.
- If it's a weapon, make sure its
Equipment Type is set toWeapon and appropriately set other relevant properties. - For healing items,
Equipment Type should be set toHotKey , with itsStat Consume parameters set accordingly. - If you want things to happen when that item is consumed, open the
Use Event which executes when the specific item is used and set up a script there.
- Giving the Item to Actors:
- Now that the item's been set up, you can give it to actors with the
Add/Remove Item function. - It can also be used in combination with
Equip Item if you want the actor to instantly equip it to their slot.
- Now that the item's been set up, you can give it to actors with the
- Test the Game:
- Run the project to verify the new item can be added to actors' inventory and works as expected.
Creating a New Enemy
Follow these steps to add a new enemy to the demo:
- Create the New Enemy Graphic:
- Open
and double-click theTools >Resources Body Sprite Resource . - Select an empty tile, and click the
Import Images/Models icon or theImport Animation Frames one right next to it if you have multiple images forming an animation sequence. - Now click the
Add Box Collision icon ("Shared with whole Tile") to add a new collision box to the sequencer. Set up its size and line it up with the graphic. - Follow the same procedure for the "Attacking" pose as well, if you want a different animation sequence to play when the enemy is attacking another.
- Open
- Set up the New Enemy:
- Load the
Scene Resource you want to place the enemy in. - On the
Objects panel, double-click theCharacter object to create an object based off of theCharacter class. - While the newly created object is selected, head down on its
Properties panel until you find theLayers property. Add a new layer to it by clicking+ once beside it. - Set the
Sprite value to the sprite resource you created/imported the new enemy's graphic in, and theTile to which tile you created it on. The count starts from 0, so if you created it on the 3rd tile, its # would be 4. - Since this is supposed to be an enemy, set the
Team property toBad . - Make sure to also set up its
Statistics and enable AI by tickingAI Enabled at the bottom. - It also needs a weapon in order to be able to attack. This can be done with the
Equip Item function, preferably executed via the actor'sCreated Event .
- Load the
- Test the Game:
- Run the project to verify the new enemy shows up and behaves as expected.
Creating a New Map/Scene
Follow these steps to add a new scene to the demo:
- Create the New Scene:
- On the
Project panel, click theCreate Scene icon, give it a name and create it. - Select the
Tiles and begin drawing the map using the provided tools (pencil, rectangle etc.). - Click on the imported square image to select it, and then click anywhere on the sequencer to place it. You can confirm you have added it by seeing a new entry on the timeline sequencer located right below the sprite sequencer.
- On the
- Moving in/out of the Scene:
- Moving actors and objects between
Scenes is done using theRelocate function. To make a connection from oneScene to another, you can use theCollision Actor Started Event of an actor. - You can find two such examples on the
StartingMap andForest Scenes in the RPG demo. They look like blue rectangular zones. - By coming in contact with the player, a
Relocate function executed within theirCollision Actor Started Event repositions the player from one map to another. They can be visualized in the editor thanks to a 3D model cube from theMisc Sprite Resource being set as their 1st layer, but are invisible in the actual gameplay due to theirVisible property being unchecked. - Copy+paste this actor and head into their
Collision Actor Started Event to edit the script and have the player go to the new map. - From the existing script you need only keep the first two branches which essentially check if the actor colliding with them is the player, and the
Relocate function found at the very end. - Change the
Scene parameter to the new one you created. You can now also copy and paste this to the newScene and edit theEvent to also have a way back.
- Moving actors and objects between
- Test the Game:
- Run the project to verify the new
Scene looks fine and works as expected.
If you think anything is missing, please feel free to: submit documentation feedback on this page